<template>
	<view v-if="!isLogin" class="loginleftright">
		<view class="uni-flex uni-column">
			<view class="title">{{title}}</view>
		</view>
		<u-form :model="form" ref="uForm">
			<u-form-item label="账号" prop="username" label-width="100" required >
				<u-input v-model="form.username"  placeholder='请输入自己的大名' />
			</u-form-item>
			<u-form-item label="房间号" prop="roomid" label-width="100" required >
				<u-input v-model="form.roomid" placeholder='请输入房间号' />
			</u-form-item>
			<view class="btns">
				<u-button class="ubtn" @click="submit">进入</u-button>
			</view>
		</u-form>
	</view>
</template>

<script>
	export default {
		name:"sfulogin",
		props:['title'],
		data() {
			return {
				isLogin:false,
				form: {
					username: '',
					roomid: '',
				},
			};
		},
		methods:{
			submit() {
				if (this.form.username == '' || this.form.roomid == ''){
					console.log(this.form,this.form.roomid);
					return;
				}
				this.$emit('loginEvent',this.form.username,this.form.roomid)
			}
		}
	}
</script>

<style>
.loginleftright{
		margin-left: 130rpx;
		margin-right: 130rpx;
	}
</style>